﻿<%@ include file="/WEB-INF/views/framework/global.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>课题查看</title>
</head>
<body class="kk">
	<ul class="nav nav-tabs g_navbar">
		<li class="active"><a href="#">毕业设计课题</a></li>
	</ul>
	<c:if test="${topic.id==null}">
		<div class="framework_container mytopic">
			<section class="persion_tip">
				<a class="abs create_report" href="${reqRoot}/update"><h2 class="fw">创建课题</h2></a>
			</section>
		</div>
		<!-- /framework_container -->
	</c:if>

	<c:if test="${topic.id!= null}">
		<div class="framework_container">
			<section class="row">
				<div class="col-md-2"></div>
				<div class="col-md-8">
					<form id="my_form" role="form" action="${reqCmpRoot}/add" method="post">
						<input type="hidden" id="id" name="id" value="${topic.id}" />
						<div class="row">
							<div class="col-md-10">
								<h3 class="fw"><c:out value="${topic.name}"/></h3>
								<h6>作者：${creatorName}&nbsp;&nbsp;/&nbsp;&nbsp;状态：<span id="status">${topic.status}</span></h6>
							</div>
							<div class="col-md-2">
								<sec:authorize access="hasRole('STUDENT')">
									<c:if test="${topic.status!= 'SUBMIT'}">
										<a class="btn btn-default ie_dib mt20" href="${reqRoot}/update">修改</a>
										<a class="btn btn-success ie_dib mt20" href="#" id="submitBtn" style="color:#FFFFFF;">提交</a>
									</c:if>
								</sec:authorize>
							</div>
						</div>
						<br>
						<div id="content" style="line-height:25px;">
							<article>${topic.content}</article>
						</div>
					</form>
				</div>
				<div class="col-md-2"></div>
			</section>
		</div>
		
		<!-- 评论 -->	
		<c:if test="${count > 0}">
		<article class="comments_box row pt20">
			<div class="col-md-2"></div>
			<hgroup class="col-md-8">
				<div><span class="ie_dib comments_number">${count}条评论</span></div>
				<c:forEach items="${comments}" var="comment">
				<section class="comments_item">
					<div class="teacher_name">${user.teacher.name} &nbsp;&nbsp;${comment.created}</div>
					<div class="teacher_comment">${comment.content}&nbsp;</div>
					<i class="persion_head"></i>
				</section>        
		        </c:forEach>
				<div class="haha_line mt10 mb10"></div>
			</hgroup>
			<div class="col-md-2"></div>
		</article><!-- /评论 -->
		</c:if>
	</c:if>
	<script src="${cmpRoot}/student_topic_index.js"></script>
</body>
</html>
